import {useState} from 'react';
import axios from 'axios';

export function NewFizzBuzz() {
	const [value, setValue] = useState();
	return (
		<>
			<div data-testid="result">{value}</div>
			<button onClick={() => setValue(3)}>3</button>
			<button onClick={async () => {
				const numberResult = await axios.get('http://localhost:8019/number/' + value);
				console.log(numberResult);
				setValue(
					numberResult.data.result,
				)
			}}>=
			</button>
		</>
	);
}
